<?php defined('SYSPATH') or die('No direct script access.');

class Model_ShopCategory extends Model_Filter
{ 
    protected $_table_name = 'shopcategories';
    protected $_reload_on_wakeup = false; 
    
    public function get_category_by_url($url)
    {
        $category = ORM::factory('shopcategory')->where('url', '=', $url)->find();
        if (!$category->loaded()) {
            throw new HTTP_Exception_404('Запись не найдена');      
        }
        return $category;
    }
}
